<style type="text/css">
    

    .news-left {
        width: 300px;
        float: left;
        margin-right: 15px;
    }

    .news-right {
        overflow: hidden;
        width: 980px;
        position: relative;
        display: inline-block;
    }

    .news-left .news-item {
        height: 150px;
        cursor: pointer;
        max-width: 270px;
        overflow: hidden;
        position: relative;
        border: 1px solid #ccc;
        background-size: cover;
        background-position: center center
    }

    .news-left .news-item.active {
        border: 1px solid #44b549 !important
    }

    .news-left .article-add {
        color: #999;
        display: block;
        font-size: 22px;
        text-align: center
    }

    .news-left .article-add:hover {
        color: #666
    }

    .news-left .news-title {
        bottom: 0;
        color: #fff;
        width: 272px;
        display: block;
        padding: 0 5px;
        max-height: 6em;
        overflow: hidden;
        margin-left: -1px;
        position: absolute;
        text-overflow: ellipsis;
        background: rgba(0, 0, 0, .7)
    }

    .news-left .news-item a {
        color: #fff;
        width: 30px;
        height: 30px;
        float: right;
        font-size: 12px;
        margin-top: -1px;
        line-height: 34px;
        text-align: center;
        margin-right: -1px;
        background-color: rgba(0, 0, 0, .5)
    }

    .news-left .news-item:hover a {
        display: inline-block !important
    }

    .news-left .news-item a:hover {
        text-decoration: none;
        background-color: #0C0C0C
    }

   .upload-image-box {
        width: 130px;
        height: 90px;
        border: 1px solid rgba(125, 125, 125, .1);
        background: url("__ROOT__/static/theme/img/yb.png") no-repeat center center;
        background-size: cover;
    }

    .ybimage{width: 140px !important;}
    .newimg_1l{border:1px solid #e6e6e6;min-height:8rem;position:relative;margin-bottom:10px;border-radius: 8px;}
    .showaddico{position: absolute;top:35%;width:100%;text-align:center;}

    .showaddico .layui-icon{font-size:2.5rem;color:#06C}
    .showaddico .uploadico_text{color:#06C;}
    .newimg_1l .thisnoimg{width:100%;text-align:center;opacity:0.5}
    .newimg_1l .thisnoimg:hover{opacity:1;}
    .newimg_1l .thisnoimg img{height:100%}
     .newimg_1l .thisshowimg{width:100%;text-align:center;}
     .newimg_1l .thisshowimg:hover,.showaddico:hover{
      cursor:pointer;
     }
     .showaddico:hover .layui-icon{
        color: #46a2ff;
     }
     .newimg_1l .thisshowimg img{height:100%;width: 50%;}
     .newimg_1l .delimg{position:absolute;right:5px;top:5px;z-index: 1;}
     .newimg_1l .delimg .layui-icon{font-size:1.5rem;color:#06C}

</style>
{php}
{//var_dump($vo);}
{/php}
<form  class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">

    <div class="layui-card-body">
        <div class="layui-form-item">

            {if @$vo.id}
            <label class="layui-form-label label-required">变更公司名称</label>
            {else}
            <label class="layui-form-label label-required">公司名称</label>
            {/if}
            <div class="layui-input-block">
                <input name="name" value='{$companyname[0]["name"]|default=""}' required placeholder="请输入公司名称" class="layui-input">
            </div>
        </div>

        
        <div class="layui-form-item">

           
            <label class="layui-form-label label-required">公司信用代码</label>
          
            <div class="layui-input-block">
                {if @$vo.code}
                    <input name="code" value='{$companyname[0]["code"]|default=""}' placeholder="公司信用代码" class="layui-input">
                {else}
                    <input name="code" value='' placeholder="公司信用代码(上传营业执照自动填写)" class="layui-input">
                {/if}
            </div>
        </div>
       
        <div class="layui-form-item">

            {if @$vo.address}
            <label class="layui-form-label label-required">变更公司地址</label>
            {else}
            <label class="layui-form-label label-required">公司地址</label>
            {/if}
            <div class="layui-input-block">
                <input name="address" value='{$companyname[0]["address"]|default=""}' required placeholder="请输入公司地址" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">

            {if @$vo.corporation}
            <label class="layui-form-label label-required">法定代表人</label>
            {else}
            <label class="layui-form-label label-required">法定代表人</label>
            {/if}
            <div class="layui-input-block">
                <input name="corporation" value='{$companyname[0]["corporation"]|default=""}' required placeholder="请输入法定代表人" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            {if @$vo.id}
             <label class="layui-form-label ">绑定用户</label>
            {else}
             <label class="layui-form-label ">绑定用户</label>
            {/if}
           
            <div class="layui-input-block">
              <div  style="position: absolute;z-index: 2;width: 20%;right: 0;" >
                <input type="checkbox" name="createuid_changer" lay-filter="createuid_switch" lay-skin="switch" lay-text="更换|原始">
              </div>
            <select  disabled class="layui-select createuid-select" name="createuid" >
            <option value="">-- 绑定用户 --</option>
                {foreach $data['userlist'] as $key=>$val}
                    {if($val.name eq @$vo.user_name )}
                
                     
                    <option selected value="{$val.id}">{$val.name}</option>
                    {else}
                    <option value="{$val.id}">{$val.name}</option>
                  
                    {/if}
                {/foreach}
            </select>

            
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label label-required">公司类型</label>
            <div class="layui-input-block">
                <div class="layui-textarea padding-bottom-10" style="min-height:auto">
                    {foreach ['1'=>"普通公司(商户)",'2'=>"物业",'3'=>"普通公司(无需绑定物业)"] as $key=>$val}

                    {if @$vo.type eq $key}
                    <label class="think-radio layui-unselect">
                        <input lay-filter="ChoiceRadio" type="radio" name="type" checked="checked" value="{$key}" lay-ignore> {$val}
                    </label>
                    {else}
                      <label class="think-radio layui-unselect">
                        <input lay-filter="ChoiceRadio" type="radio" name="type"  value="{$key}" lay-ignore> {$val}
                    </label>
                    {/if}
                    {/foreach}

                </div>
            </div>
        </div>

        <div class="layui-form-item" id="ch-company-type">

            {if @$vo.id}
            <label class="layui-form-label label-required">变更物业管理公司</label>
            {else}
            <label class="layui-form-label label-required">所属物业公司</label>
            {/if}

            {if $userinfo['db1']['authorize'] ==1}

            <div class="layui-input-block">
            <select  class="layui-select" name="property_id" >
            <option value="">-- 绑定物业公司 --</option>
                {foreach $data['propertylist'] as $key=>$val}
                    {if($val.name eq @$vo.property_name )}
                
                     
                    <option selected value="{$val.id}">{$val.name}</option>
                    {else}
                    <option value="{$val.id}">{$val.name}</option>
                  
                    {/if}
                {/foreach}
            </select>
            </div>
            {else}
              <input name="property_name" value='{$vo.property_name|default="暂无"}' class="layui-input">
              {notempty name='vo.id'}<input type='hidden' value='{$vo.property_id}' name='property_id'>{/notempty}
            {/if}

        </div>



        <div class="layui-form-item" id="newimg-box">
<!--                       <div style="display: none;">
             <input name="uploadyyzz" type="hidden" value="{$vo.warrant|default=''}">
          <script>$('[name="uploadyyzz"]').uploadOneImage()</script>
        </div> -->
            <label class="layui-form-label label-required">公司营业执照</label>

            <div class="layui-input-block">



        <div class="newimg_1l" id="newimg_yyzz">
            <div  style="display: none;">
                       <input name="uploadyyzz" type="hidden" value="{$vo.imgurl|default=''}">
          <script>$('[name="uploadyyzz"]').uploadOneImage()</script>
            </div>
            <!--删除按钮-->
            <div class="delimg"> 
                <i class="layui-icon layui-icon-delete"></i>
            </div>
            <!--有图片状态-->
           
           <!--没有图片状态-->
        
          
                {if @$vo['imgurl']}
                {php}

                   {
                  //路径1
                    if (strstr($vo['imgurl'],'http://pc.zsicp.com') || strstr($vo['imgurl'],'http://devs.zsicp.com')){
                        echo  "<div id='normalupimg' class='thisshowimg'> <img data-tips-image class='ybimage' src=".$vo['imgurl']."></div>";
                    }else{
                  //路径2
                        echo "<div id='normalupimg' class='thisshowimg'><img data-tips-image class='ybimage' data-tips-image src="."http://devs.zsicp.com/public/upload/business_license/".$vo['imgurl']."></div>";   
                    }
                
                    }
                {/php}

                {else}
                <!-- none --> 
                <div id='normalupimg' class='thisnoimg'><img data-tips-image class='ybimage' src='__ROOT__/static/theme/img/yb.png'></div>
            {/if}
    
           <!--上传按钮-->
           <div class="showaddico">
               
               <i class="layui-icon layui-icon-add-circle "></i>
               <div class="uploadico_text padding-top-10">
                   请上传证件照
               </div>
           </div>
        </div>

               <!--  old uoload -->
                <div class="layui-textarea padding-bottom-10" style="min-height:auto;display: none;">
                {if @!$vo.id}
                    <span id="upload-btn-tips" class="color-green">(是否上传营业执照)</span>
                   <!--  <input checked lay-filter="upye_switch" type="checkbox" name="upye_switch" lay-skin="switch"> -->
                {/if}
                <div id="NewsEditor" class="layui-clear nowrap padding-bottom-30">
                <span class="color-green">(营业执照-缩略图)</span>
                {notempty name='vo.imgurl'}
               {php}
               {
            
                if (strstr($vo['imgurl'],'http://pc.zsicp.com')){
                    echo  "<img name="."old_imgurl"." data-tips-image style="."max-width:120px;height:60px;vertical-align:top"." src=".$vo['imgurl']." class="."margin-right-5".">";

                  echo "<input data-auto-none value=".$vo['imgurl']." type="."hidden"." name="."old_imgurl".">";
                }else{
 

                    echo  "<img name="."old_imgurl"." data-tips-image style="."max-width:120px;height:60px;vertical-align:top"." src="."http://devs.zsicp.com/public/upload/business_license/".$vo['imgurl']." class="."margin-right-5".">";

                    echo "<input data-auto-none value=".$vo['imgurl']." type="."hidden"." name="."old_imgurl".">";
                }
            
                }
               {/php}


                {/notempty}
               {notempty name='vo.id'}
                    <label class="layui-form-label">使用原有营业执照</label>
                
    <div class="layui-input-block" >
      <input lay-filter="ye_switch" type="checkbox" name="ye_switch" lay-skin="switch">
    </div>
    {/notempty}
                <div class="layui-form-item label-required-prev upload_yye">

                    <div class="layui-clear">
  
                        <div class="upload-image-box pull-left transition" data-tips-image="{{item.local_url}}" style="{{item.style}}">
                            <input ng-model="item.local_url" data-auto-none value="{{item.local_url}}" type="hidden" name="local_url">
                        </div>
                        <div class="pull-left padding-top-15 padding-left-15">
                           
                            <button type="button" data-title="上传营业执照" data-file="btn" data-type="jpg,png,jpeg" data-field="local_url" class="layui-btn layui-btn-sm layui-btn-primary">
                            {if @$vo.id}
                            重新上传营业执照
                            {else}
                            上传营业执照
                            {/if}
                        </button>


                            <br>
<!--                             <label class="think-checkbox notselect margin-top-15">
                                <input ng-model="item.show_cover_pic" ng-checked="!!item.show_cover_pic" data-auto-none type="checkbox" value="1" name="show_cover_pic"> 在正文顶部显示此图片
                            </label> -->
                        </div>
                    </div>
                    <p class="color-desc">封面大图片建议尺寸 900像素 * 500像素</p>
                </div>
                </div>
                </div>
            </div>
        </div>
        {if false}
        <div class="layui-form-item">
            <label class="layui-form-label">公司套餐信息</label>

            <div class="layui-input-block">

                <div class="layui-textarea padding-bottom-10" style="min-height:auto">

          <div class="layui-form-item font-size-20">
              <label class="relative block">
                 <!--  <span class="color-green font-w7">会员信息</span> -->
                  <span class="color-desc margin-left-5">Member</span>
                  <p class="margin-left-5">

                  {if @$data.member_info}
                    {if condition="($data.member_info.vip_level eq 0)"}
                      <span class="color-blue">访客会员</span>
                       {elseif condition="($data.member_info.vip_level eq 1)"/}
                       <span class="color-blue">租户会员</span>
                        {elseif condition="($data.member_info.vip_level eq 2)"/}
                        <span class="color-blue">物业会员</span>
                         {elseif condition="($data.member_info.vip_level eq 3)"/}
                         <span class="color-blue">企业会员</span>
                         {else /}
                    {/if}
                  </br>

                  {if condition="($data.member_info.year neq 0)"}
                      <span class="color-blue">套餐类型: {$data.member_info.year|default=''}/年付</span>
                    {elseif condition="($data.member_info.month neq 0)"/}
                      <span class="color-blue">套餐类型: {$data.member_info.month|default=''}/月付</span>
                    {elseif condition="($data.member_info.day neq 0)"/}
                      <span class="color-blue">套餐类型: {$data.member_info.day|default=''}/日付</span>
                    {else /}
                  {/if}
                </br>
                  <span class="color-blue">续费日期:{$data.member_info.vip_date|default=''}</span>
                    {else}
                      暂无信息
                  {/if}

                </p>
                 <!--   <input readonly value="{$storememberinfo['title']|default=''}" class="layui-input layui-bg-gray"> -->
                

              </label>  
              <p class="help-block"></p>
          </div>

                </div>
            </div>
        </div>
        {/if}
        <div class="layui-form-item">
            <label class="layui-form-label">操作选项</label>

            <div class="layui-input-block">

                <div class="layui-textarea padding-bottom-10" style="min-height:auto">
            {if @$vo.id}
            <div class="layui-row layui-col-space10">
              <div class="layui-col-md3">
                  <button type="button" data-modal="{:url('invitation/invitation/index')}?company_id={$vo.id}" data-title="查看企业邀请" class='layui-btn layui-btn-sm  layui-btn-normal'>查看企业邀请</button>
              </div>
             <div class="layui-col-md3">
                  <button type="button" data-modal="{:url('visitor/visitor/index')}?company_id={$vo.id}" data-title="查看企业访客" class='layui-btn layui-btn-sm  layui-btn-normal'>查看企业访客</button>
             </div>

            <div class="layui-col-md3">
                  <button type="button" data-modal="{:url('company/department/index')}?company_id={$vo.id}" data-title="查看企业部门" class='layui-btn layui-btn-sm  layui-btn-normal'>查看企业部门</button>
             </div>
            <div class="layui-col-md3">
                  <button type="button" data-modal="{:url('question/question/index')}?company_id={$vo.id}" data-title="查看企业培训题目" class='layui-btn layui-btn-sm  layui-btn-normal'>查看企业培训题目</button>
             </div>

                {if auth("remove")}
                {if @$vo.id!=9999}
            <div class="layui-col-md3">
           <!--      <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该企业吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}" action="{:url('company/remove')}">删除该企业</a> -->
                <a id="del_company_btn" class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该企业吗？" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删除该企业</a>

            </div>
                    {/if}
                {/if}
                 {if auth("state") and $vo.status neq 2}
                  <div class="layui-col-md3">
                      <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};code#{$vo.code};status#2" data-csrf="{:systoken('state')}">审核-通过</a>
                  </div>
                  <div class="layui-col-md3">
                      <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('state')}"  data-value="id#{$vo.id};code#{$vo.code};status#1" data-csrf="{:systoken('state')}">审核-不通过</a>

                     </div>
                 {/if}
                

  <!--           <div class="layui-col-md3">
                  <button type="button" data-open="{:url('visitor/visitor/index')}?company_id={$vo.id}" data-title="查看企业访客" data-close class='layui-btn layui-btn-sm  layui-btn-normal'>查看企业部门人员</button>
             </div> -->

            </div>
                <!-- 修改操作 -->
                {else}
                <!-- 添加操作 -->
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md3">
                        <span id="upload-btn-tips" class="color-green">(是否上传营业执照)</span>
                        <input lay-text="是|否" class="layui-inline" checked lay-filter="upye_switch" type="checkbox" name="upye_switch" lay-skin="switch">
                    </div>
                </div>
                  {/if}

                </div>
            </div>
        </div>
    </div>




    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
    <input type='hidden' value='0' name='Ch_result'>
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>


</form>


{block name='script'}

<script>

    require(['angular', 'ckeditor','selectM','selectN'], function () {

        var $form = $('form[name="news"]');
        var $vali = $form.vali().data('validate');
        // var editor = window.createEditor('[name="content"]');

        var app = angular.module("NewsEditor", []).run(callback);
        angular.bootstrap(document.getElementById(app.name), [app.name]);

        //监听验证绑定用户和删除公司
 //        $('input[name="Ch_result"]').change(function(res){
 //          var chtype_val = $('input[name="Ch_result"]').val()
 //          if(chtype_val=='Cuser1'){
 // // Cuser Cdel
 //            console.log(chtype_val)
 //            $('.createuid-select').attr('disabled',true)
 //          }
 //          if(chtype_val=='Cdel1'){
 // // Cuser Cdel
        
 //          }
 //        })
        //更换绑定用户
         form.on('switch(createuid_switch)', function(data){
          console.log($('.createuid-select').is('disabled'))
          console.log($('input[name="Ch_result"]').val())
          if($('input[name="Ch_result"]').val()!='0'){return}
          if(data.elem.checked){
              var companyid = "{$vo.id}";
              $.form.modal("{:url('company/company/verif')}?companyid="+companyid+"&ty=Cuser")
          }
        })
        //删除企业
        $('#del_company_btn').on('click',function(){
           var companyid = "{$vo.id}";
           $.form.modal("{:url('company/company/verif')}?companyid="+companyid+"&ty=Cdel")
        })
        
        //检查营业执照
        var voinfo = "{$vo.id}"
        if(voinfo!=0){
          if("{$vo.imgurl}"){
             $('#newimg_yyzz .showaddico').css({'display':'none'})
          }
        }

        form.on('switch(upye_switch)', function(data){
            console.log(data.elem); //得到checkbox原始DOM对象
        // 　　console.log(data.elem.checked); //开关是否开启，true或者false
        // 　　console.log(data.value); //开关value值，也可以通过data.elem.value得到
        // 　　console.log(data.othis); //得到美化后的DOM对象
            if(!data.elem.checked){
                //新的上传组件
                $('#newimg-box').css({'display':'none'});
                $('.upload_yye').css({'display':'none'});
             }else{
                $('#newimg-box').css({'display':'block'});
                $('.upload_yye').css({'display':'block'});
                }
            
            

        });

        form.on('switch(ye_switch)', function(data){
            console.log(data.elem); //得到checkbox原始DOM对象
        // 　　console.log(data.elem.checked); //开关是否开启，true或者false
        // 　　console.log(data.value); //开关value值，也可以通过data.elem.value得到
        // 　　console.log(data.othis); //得到美化后的DOM对象
            if(data.elem.checked){

                $('.upload_yye').css({'display':'none'});
             }else{
                $('.upload_yye').css({'display':'block'});
                }
        });
        $("input[name='type']").change(function(data){
           var radioval = $('input[name="type"]:checked').val();
           console.log(radioval)
           if(radioval == 2 || radioval == 3 ){
                $('#ch-company-type').css({'display':'none'});
           }else{
                $('#ch-company-type').css({'display':'block'});
           }

        })
        $('.delimg').on('click',function(){
            var fater_parent = $(this).parent().attr('id')
            return $.msg.confirm('删除并重新上传营业执照?',function(okres){
              $('#'+fater_parent+' #normalupimg img').removeClass('thisnoimg')
              $('#'+fater_parent+' #normalupimg img').removeClass('thisshowimg')
              $('#'+fater_parent+' #normalupimg img').removeClass('ybimage')


              if(fater_parent =='newimg_yyzz'){
                $('#'+fater_parent+' #normalupimg img').attr('src',"__ROOT__/static/theme/img/yb.png")
              }
              //授权书
              // if(fater_parent =='newimg_sqs'){
              //   $('#'+fater_parent+' #normalupimg img').attr('src',"")
              // }   
            
                $('#'+fater_parent+' #normalupimg img').addClass('thisnoimg')
                $('#'+fater_parent+' #normalupimg img').addClass('ybimage')
                $('#'+fater_parent+' .showaddico').css({'display':'block'})
                //手动关闭 全局没
                $.msg.close(okres);
            });
        })
        /**上传按钮**/
        $('.showaddico').on('click',function(){
            $('#newimg_yyzz .uploadimage').click();
        })
        /**监听上传**/
        $('input[name="uploadyyzz"]').change(function(res){
            console.log(res)
            var companyid = eval('{if @$vo["id"]}{$vo["id"]}{else}0{/if}')
            var imgurlvalue = $('input[name="uploadyyzz"]').val()
            if(companyid){
                postdata = {
                    'local_url':imgurlvalue,
                    'type':'update'
                    };
                }else{
                postdata = {
                    'local_url':imgurlvalue,
                    };
                }
                console.log(postdata)
            // 待改到person接口
            $.post("{:url('company/upload')}",postdata, function(result) {
             
              result = JSON.parse(result)

              if (result.code == 200) {
                  //成功
                  $('input[name="name"]').val(result.data.name)
                  $('input[name="code"]').val(result.data.code)
                  $('input[name="address"]').val(result.data.address)
                  $('input[name="corporation"]').val(result.data.corporation)

                  $('#newimg_yyzz #normalupimg img').attr('src',imgurlvalue)
                  $('#newimg_yyzz .showaddico').css({'display':'none'})
                  $('#newimg_yyzz #normalupimg img').removeClass('thisnoimg')
                  return $.msg.success(result.message);
              } else if (result.code == 400) {
                  // 失败
                  return $.msg.error(result.message);
              }
                  }, "JSON");
        })
        /**选择手机后**/
        form.on('select(watchphone)', function(data){
          console.log(data)
              $.ajax({
                url:"{:url('company/user/getuserlist')}",
                data:{id:data.value},
                type:'post',
                async: false,
                dataType:'json',
                success:function(res) {
                  var reres = JSON.parse(res)
                  console.log(reres)
                  if(reres.data.roleid==2){
                    $('.authorize-changer').css({'display':'block'})
                  }else{
                    $('.authorize-changer').css({'display':'none'})
                    $('input[name="ch_role"]').val('off');
                  }
                  $('#searchname').val(reres.data.name)
                  $("input[name='mobile']").val(reres.data.mobile)
                  $("input[name='userid']").val(reres.data.id)
                }
            })
          });


        /**搜索电话监听**/
        $("#searchphone").on("input",function(e){
            $("#searchphonelist").next().find("dl").css({ "display": "block" });
            console.log(e.delegateTarget.value);
            $('#searchphonelist').html('')
            form.render('select')
            if(e.delegateTarget.value==''){return;}
            $.ajax({
              url:"{:url('company/user/getuserlist')}",
              data:{'phone':e.delegateTarget.value,'type':'phone'},
              type:'post',
              async: false,
              dataType:'json',
              success:function(res) {
                console.log(res)
                var reres = JSON.parse(res)
                var option = ''
                for (var i = 0; i < reres.data.length; i++) {
                    option = option+"<option value="+reres.data[i].id+">"+reres.data[i].mobile+"</option>"
                }
                console.log(reres)
                $('#searchphonelist').append(option)
              }
          })
            form.render('select')
        });

        function callback($rootScope) {
            $rootScope.list = [];
            $rootScope.item = {};

            $rootScope.setItemValue = function (name, value) {

                $rootScope.item[name] = value;
                $rootScope.item.style = "background-image:url('" + $rootScope.item.local_url + "')";
                var companyid = eval('{if @$vo["id"]}{$vo["id"]}{else}0{/if}')
                if(companyid){
                    postdata = {
                        'local_url':value,
                        'type':'update'
                        };
                    }else{
                    postdata = {
                        'local_url':value,
                        };
                    }
                    console.log(postdata)
                // 待改到person接口
                return
                $.post("{:url('company/upload')}",postdata, function(result) {
                 
                  result = JSON.parse(result)

                  if (result.code == 200) {
                      //成功
                      $('input[name="name"]').val(result.data.name)
                      $('input[name="code"]').val(result.data.code)
                      $('input[name="address"]').val(result.data.address)
                      $('input[name="corporation"]').val(result.data.corporation)
                      return $.msg.success(result.message);
                  } else if (result.code == 400) {
                      // 失败
                      return $.msg.error(result.message);
                  }
                      }, "JSON");

            };

            $('[name="local_url"]').on('change', function () {
                var value = this.value;
                $rootScope.$apply(function () {
                    $rootScope.setItemValue('local_url', value);
                });
            });
        }

    });
</script>
<script type="text/javascript">

// window.form.render();
form.render()
require(['formSelects'], function () {
var formSelects = layui.formSelects;

});
</script>

{/block}